summaryrefslogtreecommitdiff
path: root/libavformat/jpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/jpeg.c')
-rw-r--r--libavformat/jpeg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/jpeg.c b/libavformat/jpeg.c
index 38a955b31d..0aec8f34a2 100644
--- a/libavformat/jpeg.c
+++ b/libavformat/jpeg.c
@@ -125,11 +125,11 @@ static int jpeg_read(ByteIOContext *f,
switch(c->pix_fmt) {
default:
case PIX_FMT_YUV420P:
- w >>= 1;
- h >>= 1;
+ w = (w + 1) >> 1;
+ h = (h + 1) >> 1;
break;
case PIX_FMT_YUV422P:
- w >>= 1;
+ w = (w + 1) >> 1;
break;
case PIX_FMT_YUV444P:
break;