summaryrefslogtreecommitdiff
path: root/libavcodec/mjpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mjpeg.c')
-rw-r--r--libavcodec/mjpeg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index 068281d31c..874d1a7050 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -1874,6 +1874,9 @@ not_the_end:
}
}
the_end:
+ if(buf_ptr > buf_end)
+ buf_ptr = buf_end;
+
dprintf("mjpeg decode frame unused %d bytes\n", buf_end - buf_ptr);
// return buf_end - buf_ptr;
return buf_ptr - buf;