Unified · Split
| @@ -53,22 +53,22 @@ static int webp_init(AVFormatContext *s) · 52 unmodified lines | |||
| 53 | 53 | ||
| 54 | static int is_animated_webp_packet(AVPacket *pkt) | 54 | static int is_animated_webp_packet(AVPacket *pkt) |
| 55 | { | 55 | { |
| 56 | int skip = 0; | 56 | int skip = 0; |
| 57 | unsigned flags = 0; | 57 | unsigned flags = 0; |
| 58 | 58 | ||
| 59 | if (pkt->size < 4) | 59 | if (pkt->size < 4) |
| 60 | return AVERROR_INVALIDDATA; | 60 | return AVERROR_INVALIDDATA; |
| 61 | if (AV_RL32(pkt->data) == AV_RL32("RIFF")) | 61 | if (AV_RL32(pkt->data) == AV_RL32("RIFF")) |
| 62 | skip = 12; | 62 | skip = 12; |
| 63 | // Safe to do this as a valid WebP bitstream is >=30 bytes. | 63 | // Safe to do this as a valid WebP bitstream is >=30 bytes. |
| 64 | if (pkt->size < skip + 4) | 64 | if (pkt->size < skip + 4) |
| 65 | return AVERROR_INVALIDDATA; | 65 | return AVERROR_INVALIDDATA; |
| 66 | if (AV_RL32(pkt->data + skip) == AV_RL32("VP8X")) { | 66 | if (AV_RL32(pkt->data + skip) == AV_RL32("VP8X")) { |
| 67 | flags |= pkt->data[skip + 4 + 4]; | 67 | flags |= pkt->data[skip + 4 + 4]; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | if (flags & 2) // ANIMATION_FLAG is on | 70 | if (flags & 2) // ANIMATION_FLAG is on |
| 71 | return 1; | 71 | return 1; |
| 72 | return 0; | 72 | return 0; |
| 73 | } | 73 | } |
| 74 | 74 | ||