diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-14 11:55:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-14 11:56:12 +0200 |
commit | 2bac839bd3c3d0865199f4e7cc478afdb10b66c6 (patch) | |
tree | c06faed687af6b2e7080fa49c06137b3e219a835 | |
parent | d12bc01ec55a78b33ab9bef8377ae6adff03354a (diff) | |
parent | f13fe6020e6a3871f9b0c96b240e58e6ed4fb5d7 (diff) | |
download | ffmpeg-2bac839bd3c3d0865199f4e7cc478afdb10b66c6.tar.gz |
Merge commit 'f13fe6020e6a3871f9b0c96b240e58e6ed4fb5d7'
* commit 'f13fe6020e6a3871f9b0c96b240e58e6ed4fb5d7':
rtjpeg: Use init_get_bits8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/rtjpeg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/rtjpeg.c b/libavcodec/rtjpeg.c index e8fcfc6d7a..860d95821d 100644 --- a/libavcodec/rtjpeg.c +++ b/libavcodec/rtjpeg.c @@ -107,10 +107,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 { \ |