CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 23:17:20 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/opencv/opencv.git
etag: W/"dbeb0eb46d6041df4be60e2175bf66c1"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=DWK4EdUBDXgYUVqfGfiv3JoahTTjrkXKwJ3i0Yg%2FVO%2FwG4dVqGvYcISwdulUk5PtsY3ywtUA7ZowYkpJGOrmFxXBpjrS6jJGtq%2FLqFbY%2FTA50rOYxC5K%2B2a8lubiAKLBg2olzqAC6t2wIu81mg86Tf8mqHKnj2Tff%2BPwnLuy1rLTCfwV%2FRnQxxzuB%2FSrbPHJzjVh%2FLPnZHLpkadiaqPCZu1ao9AMuuM%2F4TX9d6DvVM%2Bjb1EsYIDOEklchWFE7PKvlcUkIYSUwh1hIwJfzcPBwA%3D%3D--EDrP2MCYMr7LcY1n--yoy%2FfcIfs1f%2BpnAA6AbHjA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1042606207.1753658240; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 23:17:20 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 23:17:20 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: DF18:22FFCB:421C44:57889D:6886B380
Merge pull request #26738 from redhecker:fix · opencv/opencv@2c2866a · GitHub
Copy file name to clipboardExpand all lines: modules/imgcodecs/src/grfmt_gif.cpp
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Commit 2c2866a
authored
Merge pull request #26738 from redhecker:fix
Fix bugs in GIF decoding #26738
### Pull Request Readiness Checklist
this is related to #25691
i solved two bugs here:
1. the decoding setting:
according to [https://www.w3.org/Graphics/GIF/spec-gif89a.txt](https://www.w3.org/Graphics/GIF/spec-gif89a.txt)
```
DEFERRED CLEAR CODE IN LZW COMPRESSION
There has been confusion about where clear codes can be found in the
data stream. As the specification says, they may appear at anytime. There
is not a requirement to send a clear code when the string table is full.
It is the encoder's decision as to when the table should be cleared. When
the table is full, the encoder can chose to use the table as is, making no
changes to it until the encoder chooses to clear it. The encoder during
this time sends out codes that are of the maximum Code Size.
As we can see from the above, when the decoder's table is full, it must
not change the table until a clear code is received. The Code Size is that
of the maximum Code Size. Processing other than this is done normally.
Because of a large base of decoders that do not handle the decompression in
this manner, we ask developers of GIF encoding software to NOT implement
this feature until at least January 1991 and later if they see that their
particular market is not ready for it. This will give developers of GIF
decoding software time to implement this feature and to get it into the
hands of their clients before the decoders start "breaking" on the new
GIF's. It is not required that encoders change their software to take
advantage of the deferred clear code, but it is for decoders.
```
at first i didn't consider this case, thus leads to a bug discussed in #25691. the changes made in function lzwDecode() is aiming at solving this.
2. the fetch method of loopCount:
in the codes at https://github.com/opencv/opencv/blob/4.x/modules/imgcodecs/src/grfmt_gif.cpp#L410, if the branch is taken, 3 more bytes will be taken, leading to unpredictable behavior.
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake1 parent 1e31f80 commit 2c2866aCopy full SHA for 2c2866a
File tree
Expand file treeCollapse file tree
1 file changed
+50
-24
lines changedFilter options
- modules/imgcodecs/src
Expand file treeCollapse file tree
1 file changed
+50
-24
lines changedmodules/imgcodecs/src/grfmt_gif.cpp
Copy file name to clipboardExpand all lines: modules/imgcodecs/src/grfmt_gif.cpp+50-24Lines changed: 50 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
| |||
293 | 294 |
| |
294 | 295 |
| |
295 | 296 |
| |
| 297 | + | |
296 | 298 |
| |
297 | 299 |
| |
298 | 300 |
| |
299 | 301 |
| |
300 |
| - | |
| 302 | + | |
301 | 303 |
| |
302 | 304 |
| |
303 | 305 |
| |
| |||
321 | 323 |
| |
322 | 324 |
| |
323 | 325 |
| |
| 326 | + | |
324 | 327 |
| |
325 | 328 |
| |
326 | 329 |
| |
| |||
341 | 344 |
| |
342 | 345 |
| |
343 | 346 |
| |
344 |
| - | |
345 |
| - | |
346 |
| - | |
347 |
| - | |
348 |
| - | |
349 |
| - | |
350 |
| - | |
351 |
| - | |
352 |
| - | |
353 |
| - | |
354 |
| - | |
355 |
| - | |
356 |
| - | |
357 |
| - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
358 | 365 |
| |
359 | 366 |
| |
360 | 367 |
| |
| |||
368 | 375 |
| |
369 | 376 |
| |
370 | 377 |
| |
371 |
| - | |
| 378 | + | |
372 | 379 |
| |
373 | 380 |
| |
374 | 381 |
| |
| |||
402 | 409 |
| |
403 | 410 |
| |
404 | 411 |
| |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
410 |
| - | |
411 |
| - | |
412 |
| - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
413 | 439 |
| |
414 | 440 |
| |
415 | 441 |
| |
|
You can’t perform that action at this time.
0 commit comments