#include "avcodec.h"
#include "blockdsp.h"
#include "copy_block.h"
-#include "hwaccel.h"
+#include "hwconfig.h"
#include "idctdsp.h"
#include "internal.h"
#include "jpegtables.h"
}
}
+ if (s->bayer) {
+ if (pix_fmt_id != 0x11110000 && pix_fmt_id != 0x11000000)
+ goto unk_pixfmt;
+ }
+
switch (pix_fmt_id) {
case 0x11110000: /* for bayer-encoded huffman lossless JPEGs embedded in DNGs */
+ if (!s->bayer)
+ goto unk_pixfmt;
s->avctx->pix_fmt = AV_PIX_FMT_GRAY16LE;
break;
case 0x11111100:
case 0x22122100:
case 0x21211100:
case 0x22211200:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
- else
- goto unk_pixfmt;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- break;
case 0x22221100:
case 0x22112200:
case 0x11222200:
int resync_mb_x = 0;
int vpred[6];
+ if (!s->bayer && s->nb_components < 3)
+ return AVERROR_INVALIDDATA;
+ if (s->bayer && s->nb_components > 2)
+ return AVERROR_INVALIDDATA;
if (s->nb_components <= 0 || s->nb_components > 4)
return AVERROR_INVALIDDATA;
if (s->v_max != 1 || s->h_max != 1 || !s->lossless)
unsigned nummarkers;
id = get_bits_long(&s->gb, 32);
- id2 = get_bits_long(&s->gb, 24);
+ id2 = get_bits(&s->gb, 24);
len -= 7;
if (id != AV_RB32("PROF") || id2 != AV_RB24("ILE")) {
av_log(s->avctx, AV_LOG_WARNING, "Invalid ICC_PROFILE header in APP2\n");