#include "internal.h"
#include "avcodec.h"
-#include "mpegvideo.h"
#include "h264.h"
#include "h264data.h" // FIXME FIXME FIXME
#include "h264_mvpred.h"
#include "golomb.h"
+#include "mpegutils.h"
-//#undef NDEBUG
#include <assert.h>
static const uint8_t golomb_to_inter_cbp_gray[16]={
// We assume these blocks are very rare so we do not optimize it.
h->intra_pcm_ptr = align_get_bits(&h->gb);
+ if (get_bits_left(&h->gb) < mb_size) {
+ av_log(h->avctx, AV_LOG_ERROR, "Not enough data for an intra PCM block.\n");
+ return AVERROR_INVALIDDATA;
+ }
skip_bits_long(&h->gb, mb_size);
// In deblocking, the quantizer is 0
return -1;
}
h->cbp_table[mb_xy] |= ret << 12;
- if(CHROMA444){
+ if (CHROMA444(h)) {
if( decode_luma_residual(h, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 1) < 0 ){
return -1;
}