X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Foggparsedaala.c;h=3651ca188bd88700b3005f35cee94b4eb6f6550a;hb=1466379059201662c9f5685d51ea316447fbb113;hp=24567f93a9b4aaa414ee1419077d33b18207e76e;hpb=99f2a563889285b8be3e87fb5c5ba8c86a104785;p=ffmpeg diff --git a/libavformat/oggparsedaala.c b/libavformat/oggparsedaala.c index 24567f93a9b..3651ca188bd 100644 --- a/libavformat/oggparsedaala.c +++ b/libavformat/oggparsedaala.c @@ -123,7 +123,12 @@ static int daala_header(AVFormatContext *s, int idx) hdr->frame_duration = bytestream2_get_ne32(&gb); hdr->gpshift = bytestream2_get_byte(&gb); - hdr->gpmask = (1 << hdr->gpshift) - 1; + if (hdr->gpshift >= 32) { + av_log(s, AV_LOG_ERROR, "Too large gpshift %d (>= 32).\n", + hdr->gpshift); + return AVERROR_INVALIDDATA; + } + hdr->gpmask = (1U << hdr->gpshift) - 1; hdr->format.depth = 8 + 2*(bytestream2_get_byte(&gb)-1);