Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-12-12 16:47:44 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-12-25 01:22:16 +0400
commit691dec62011fe9993809fbc793126b40cac0c584 (patch)
tree474924880c7678d26a6872fe446477717531eb8f /libavcodec/rawdec.c
parentd63e9943615fe4a7dece768e5c91616a7f63283a (diff)
Allow stream-copying grayscale mov files.
This reverts 0de2157f / r12272. Fixes ticket #3215. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r--libavcodec/rawdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 3f4a8fc86d..e1682e399e 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -108,7 +108,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
if ( avctx->codec_tag == MKTAG('r','a','w',' ')
|| avctx->codec_tag == MKTAG('N','O','1','6'))
avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_mov,
- avctx->bits_per_coded_sample);
+ avctx->bits_per_coded_sample & 0x1f);
else if (avctx->codec_tag == MKTAG('W', 'R', 'A', 'W'))
avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_avi,
avctx->bits_per_coded_sample);
@@ -134,7 +134,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
memset(context->palette->data, 0, AVPALETTE_SIZE);
}
- if ((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) &&
+ if (((avctx->bits_per_coded_sample & 0x1f) == 4 || (avctx->bits_per_coded_sample & 0x1f) == 2) &&
avctx->pix_fmt == AV_PIX_FMT_PAL8 &&
(!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))) {
context->is_2_4_bpp = 1;
@@ -207,14 +207,14 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
int i;
uint8_t *dst = frame->buf[0]->data;
buf_size = context->frame_size - AVPALETTE_SIZE;
- if (avctx->bits_per_coded_sample == 4) {
+ if ((avctx->bits_per_coded_sample & 0x1f) == 4) {
for (i = 0; 2 * i + 1 < buf_size && i<avpkt->size; i++) {
dst[2 * i + 0] = buf[i] >> 4;
dst[2 * i + 1] = buf[i] & 15;
}
linesize_align = 8;
} else {
- av_assert0(avctx->bits_per_coded_sample == 2);
+ av_assert0((avctx->bits_per_coded_sample & 0x1f) == 2);
for (i = 0; 4 * i + 3 < buf_size && i<avpkt->size; i++) {
dst[4 * i + 0] = buf[i] >> 6;
dst[4 * i + 1] = buf[i] >> 4 & 3;