[FFmpeg-devel,3/4] mpeg2video: Return correct coded frame sizes from parser

Submitted by Mark Thompson on Oct. 26, 2016, 7:43 p.m.

Details

Message ID c3547f74-ac92-09df-5bc9-493b78e80643@jkqxz.net
State New
Headers show

Commit Message

Mark Thompson Oct. 26, 2016, 7:43 p.m.
---
 libavcodec/mpegvideo_parser.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index 206f268..de70cd5 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -168,8 +168,10 @@  static void mpegvideo_extract_headers(AVCodecParserContext *s,

     if (pix_fmt != AV_PIX_FMT_NONE) {
         s->format = pix_fmt;
-        s->width  = s->coded_width  = pc->width;
-        s->height = s->coded_height = pc->height;
+        s->width  = pc->width;
+        s->height = pc->height;
+        s->coded_width  = FFALIGN(pc->width,  16);
+        s->coded_height = FFALIGN(pc->height, 16);
     }

 #if FF_API_AVCTX_TIMEBASE