aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-05-13 16:45:31 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-05-13 16:45:31 +0200
commit1f2f031c2fc3a0f5439a2f3fb22236c8e3d8f69f (patch)
tree23474a0546fe30014d980c449201b6d1bdbeb6ef
parent1337c6cf1592204c3596c85f1e32283300961fad (diff)
downloadffmpeg-1f2f031c2fc3a0f5439a2f3fb22236c8e3d8f69f.tar.gz
Set bits_per_raw_sample when decoding libopenjpeg images.
Reviewed-by: Michael Bradshaw
-rw-r--r--libavcodec/libopenjpegdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 008d8ba699..9928adba6a 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -229,6 +229,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
int width, height, ret = -1;
int pixel_size = 0;
int ispacked = 0;
+ int i;
*data_size = 0;
@@ -291,6 +292,9 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Unable to determine pixel format\n");
goto done;
}
+ for (i = 0; i < image->numcomps; i++)
+ if (image->comps[i].prec > avctx->bits_per_raw_sample)
+ avctx->bits_per_raw_sample = image->comps[i].prec;
if(picture->data[0])
ff_thread_release_buffer(avctx, picture);