File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,18 +88,12 @@ static int processInput(ByteStream* pStream) {
8888 CGIF * pGIF ;
8989 size_t sizeImageData ;
9090 int r ;
91- int numFrames ;
9291
9392 r = read_gifconfig (pStream , & gconfig );
9493 if (!r ) {
9594 return -1 ;
9695 }
9796 sizeImageData = (uint32_t )gconfig .width * (uint32_t )gconfig .height ;
98- // limit dimensions of GIF to be created
99- if (sizeImageData > (10000 * 10000 )) {
100- free (gconfig .pGlobalPalette );
101- return -1 ;
102- }
10397 gconfig .path = "/tmp/out.gif" ; // write to temporary file
10498 pGIF = cgif_newgif (& gconfig );
10599 free (gconfig .pGlobalPalette );
@@ -108,16 +102,10 @@ static int processInput(ByteStream* pStream) {
108102 return -1 ;
109103 }
110104 r = read_frameconfig (pStream , & fconfig , sizeImageData );
111- numFrames = 1 ;
112105 while (r ) {
113106 cgif_addframe (pGIF , & fconfig );
114107 free (fconfig .pImageData );
115108 free (fconfig .pLocalPalette );
116- if (numFrames >= 16 ) {
117- // limit number of frames to avoid timeouts: 16 should be more than enough
118- break ;
119- }
120- numFrames ++ ;
121109 r = read_frameconfig (pStream , & fconfig , sizeImageData );
122110 }
123111 r = cgif_close (pGIF );
Original file line number Diff line number Diff line change @@ -94,35 +94,23 @@ static int processInput(ByteStream* pStream) {
9494 CGIF * pGIF ;
9595 size_t sizeImageData ;
9696 int r ;
97- int numFrames ;
9897
9998 r = read_gifconfig (pStream , & gconfig );
10099 if (!r ) {
101100 return -1 ;
102101 }
103102 sizeImageData = (uint32_t )gconfig .width * (uint32_t )gconfig .height ;
104- // limit dimensions of GIF to be created
105- if (sizeImageData > (10000 * 10000 )) {
106- free (gconfig .pGlobalPalette );
107- return -1 ;
108- }
109103 gconfig .pWriteFn = writecb ; // discard output
110104 pGIF = cgif_newgif (& gconfig );
111105 free (gconfig .pGlobalPalette );
112106 if (pGIF == NULL ) {
113107 return -1 ;
114108 }
115109 r = read_frameconfig (pStream , & fconfig , sizeImageData );
116- numFrames = 1 ;
117110 while (r ) {
118111 cgif_addframe (pGIF , & fconfig );
119112 free (fconfig .pImageData );
120113 free (fconfig .pLocalPalette );
121- if (numFrames >= 16 ) {
122- // limit number of frames to avoid timeouts: 16 should be more than enough
123- break ;
124- }
125- numFrames ++ ;
126114 r = read_frameconfig (pStream , & fconfig , sizeImageData );
127115 }
128116 r = cgif_close (pGIF );
You can’t perform that action at this time.
0 commit comments