aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-08-13 07:05:28 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-08-24 16:47:34 +0200
commitcea1769fb62bd3356b19d32c46483883f16334c4 (patch)
treee9a44cc02f70b952e982580a882dfce779eb070e
parent082e3fd4693c22e4a35326954f226424eaa7db24 (diff)
downloadffmpeg-cea1769fb62bd3356b19d32c46483883f16334c4.tar.gz
rtjpeg: Use init_get_bits8
CC:libav-stable@libav.org (cherry picked from commit f13fe6020e6a3871f9b0c96b240e58e6ed4fb5d7) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/rtjpeg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/rtjpeg.c b/libavcodec/rtjpeg.c
index 360458540b..77baa5b66e 100644
--- a/libavcodec/rtjpeg.c
+++ b/libavcodec/rtjpeg.c
@@ -108,10 +108,13 @@ int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
const uint8_t *buf, int buf_size) {
GetBitContext gb;
int w = c->w / 16, h = c->h / 16;
- int x, y;
+ int x, y, ret;
uint8_t *y1 = f->data[0], *y2 = f->data[0] + 8 * f->linesize[0];
uint8_t *u = f->data[1], *v = f->data[2];
- init_get_bits(&gb, buf, buf_size * 8);
+
+ if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0)
+ return ret;
+
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
#define BLOCK(quant, dst, stride) do { \