summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2018-04-11 19:50:52 +0200
committerMichael Niedermayer <[email protected]>2018-06-18 01:16:03 +0200
commit22a4b599f05e7405bd25d828f967df8740ec63fa (patch)
tree760bcd6e8effba4e7e7f6794646bb4c16c29ae72
parent8d05a802dd2f47bf73dc024ae45fb5e27f5709e1 (diff)
avcodec/utils: Enforce minimum width also for VP5/6
Fixes: out of array access Fixes: poc_0411 Found-by: GwanYeong Kim <[email protected]> Tested-by: GwanYeong Kim <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 544324827e0131e43af1a54fb790a48a25fd7ba4) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0c47e761f6..ec03bdc866 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -419,7 +419,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;