You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
vp9: Read the frame size as unsigned
Sample-Id: 00001723-google Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
@@ -1198,7 +1198,7 @@ static int vp9_decode_packet(AVCodecContext *avctx, void *frame,
|
|||||||
const uint8_t *idx = data + size + 1 - idx_sz;
|
const uint8_t *idx = data + size + 1 - idx_sz;
|
||||||
|
|
||||||
while (n_frames--) {
|
while (n_frames--) {
|
||||||
int sz = AV_RL32(idx);
|
unsigned sz = AV_RL32(idx);
|
||||||
|
|
||||||
if (nbytes < 4)
|
if (nbytes < 4)
|
||||||
sz &= (1 << (8 * nbytes)) - 1;
|
sz &= (1 << (8 * nbytes)) - 1;
|
||||||
@@ -1206,7 +1206,7 @@ static int vp9_decode_packet(AVCodecContext *avctx, void *frame,
|
|||||||
|
|
||||||
if (sz > size) {
|
if (sz > size) {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Superframe packet size too big: %d > %d\n",
|
"Superframe packet size too big: %u > %d\n",
|
||||||
sz, size);
|
sz, size);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user