diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-04-11 19:50:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-08 19:45:46 +0200 |
commit | 1fbd13ebe529ef6e17bb66f2216271d933c70c39 (patch) | |
tree | b68a08e9c5d73ca762d37337aa585851e0829e63 | |
parent | c512be126b46ac5e05ab60f82cbdf89747395f74 (diff) | |
download | ffmpeg-1fbd13ebe529ef6e17bb66f2216271d933c70c39.tar.gz |
avcodec/utils: Enforce minimum width also for VP5/6
Fixes: out of array access
Fixes: poc_0411
Found-by: GwanYeong Kim <gy741.kim@gmail.com>
Tested-by: GwanYeong Kim <gy741.kim@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 544324827e0131e43af1a54fb790a48a25fd7ba4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 77c0bf8257..1e10325c1f 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -418,7 +418,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, *width = FFALIGN(*width, w_align); *height = FFALIGN(*height, h_align); - if (s->codec_id == AV_CODEC_ID_H264 || s->lowres) { + if (s->codec_id == AV_CODEC_ID_H264 || s->lowres || + s->codec_id == AV_CODEC_ID_VP5 || s->codec_id == AV_CODEC_ID_VP6 || + s->codec_id == AV_CODEC_ID_VP6F || s->codec_id == AV_CODEC_ID_VP6A + ) { // some of the optimized chroma MC reads one line too much // which is also done in mpeg decoders with lowres > 0 *height += 2; |