]> git.sesse.net Git - ffmpeg/commitdiff
lavc decoders: properly initialize AVFrame.
authorAnton Khirnov <anton@khirnov.net>
Wed, 13 Feb 2013 07:50:04 +0000 (08:50 +0100)
committerAnton Khirnov <anton@khirnov.net>
Fri, 8 Mar 2013 06:39:37 +0000 (07:39 +0100)
25 files changed:
libavcodec/avs.c
libavcodec/bethsoftvideo.c
libavcodec/c93.c
libavcodec/cinepak.c
libavcodec/dsicinav.c
libavcodec/dv.c
libavcodec/flashsv.c
libavcodec/flicvideo.c
libavcodec/fraps.c
libavcodec/iff.c
libavcodec/indeo2.c
libavcodec/mmvideo.c
libavcodec/motionpixels.c
libavcodec/msrle.c
libavcodec/msvideo1.c
libavcodec/qpeg.c
libavcodec/qtrle.c
libavcodec/rpza.c
libavcodec/smacker.c
libavcodec/smc.c
libavcodec/tiertexseqv.c
libavcodec/truemotion1.c
libavcodec/truemotion2.c
libavcodec/ulti.c
libavcodec/vmnc.c

index 45cb4484d6a8316f4395ddde4a5d37d78841cddf..da27e0013f8fdb2ef64e3569c207a33217a40be5 100644 (file)
@@ -158,8 +158,10 @@ avs_decode_frame(AVCodecContext * avctx,
 
 static av_cold int avs_decode_init(AVCodecContext * avctx)
 {
+    AvsContext *s = avctx->priv_data;
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
     avcodec_set_dimensions(avctx, 318, 198);
+    avcodec_get_frame_defaults(&s->picture);
     return 0;
 }
 
index 73145701ff6c082d211b2bb316022918064f3b66..b113bc44e77a80cad296eb8bd59b390b7c6422a5 100644 (file)
@@ -42,6 +42,7 @@ static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
 {
     BethsoftvidContext *vid = avctx->priv_data;
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
+    avcodec_get_frame_defaults(&vid->frame);
     return 0;
 }
 
index 750941e02142d3975c93de4767840e437ea90044..b534669ca2fc7993d7dc93fa4a12bad6db7cc5b7 100644 (file)
@@ -48,7 +48,10 @@ typedef enum {
 
 static av_cold int decode_init(AVCodecContext *avctx)
 {
+    C93DecoderContext *s = avctx->priv_data;
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
+    avcodec_get_frame_defaults(&s->pictures[0]);
+    avcodec_get_frame_defaults(&s->pictures[1]);
     return 0;
 }
 
index 0c5d5b0f0d2c6a2ba25d33af8f00cb7eb4cce539..e0c527cd05a12ad813f37ee83f7fefdb43badc18 100644 (file)
@@ -414,7 +414,7 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx)
         avctx->pix_fmt = AV_PIX_FMT_PAL8;
     }
 
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
 
     return 0;
 }
index 39479546cccca50b078c4029bbe94a922fc5f01d..959a82fc7b4e7ffd5f1aa10a98b4c58cd523064c 100644 (file)
@@ -96,7 +96,7 @@ static av_cold int cinvideo_decode_init(AVCodecContext *avctx)
     cin->avctx = avctx;
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
 
-    cin->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&cin->frame);
 
     cin->bitmap_size = avctx->width * avctx->height;
     for (i = 0; i < 3; ++i) {
index 91588192aec995f35e29d4d1096b97bddaa4a355..5253b7f88e2ce3ebf005e3dcdcf74e79c568ecbd 100644 (file)
@@ -313,6 +313,7 @@ av_cold int ff_dvvideo_init(AVCodecContext *avctx)
     s->idct_put[1] = ff_simple_idct248_put;  // FIXME: need to add it to DSP
     memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64);
 
+    avcodec_get_frame_defaults(&s->picture);
     avctx->coded_frame = &s->picture;
     s->avctx = avctx;
     avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
index 3f211926e36ddec589958844ff68b3455443531c..26b42e5442a1d35e820b1352858043417dac8f92 100644 (file)
@@ -115,7 +115,7 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx)
         return 1;
     }
     avctx->pix_fmt = AV_PIX_FMT_BGR24;
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
 
     return 0;
 }
index 2588619e1507680231e6aa681249abed9a9283ed..3d43e5e827d64570118e4eae43f51ab3fe33e4a6 100644 (file)
@@ -123,7 +123,7 @@ static av_cold int flic_decode_init(AVCodecContext *avctx)
                   return AVERROR_INVALIDDATA;
     }
 
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
     s->new_palette = 0;
 
     return 0;
index 2a5a5a8b381bc5a3113738766bd9bb8db3d2ce39..66ecdef419c770405980cbc4dd0638261cdbc1b5 100644 (file)
@@ -66,6 +66,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
     s->avctx  = avctx;
     s->tmpbuf = NULL;
 
+    avcodec_get_frame_defaults(&s->frame);
+
     ff_dsputil_init(&s->dsp, avctx);
 
     return 0;
index 08d548b0eaec5f0a6152a8e87946ef14033439a2..184dcab73e7566b91eeb017da124c7635f6cf143 100644 (file)
@@ -168,6 +168,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
     if (!s->planebuf)
         return AVERROR(ENOMEM);
 
+    avcodec_get_frame_defaults(&s->frame);
+
     return 0;
 }
 
index 37b3ea19cdacfcda657722de60fc38bde23a4301..a33bbb1fc920b1870481592f93303c74835c36e2 100644 (file)
@@ -219,6 +219,8 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx)
 
     avctx->pix_fmt= AV_PIX_FMT_YUV410P;
 
+    avcodec_get_frame_defaults(&ic->picture);
+
     ir2_vlc.table = vlc_tables;
     ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;
 #ifdef BITSTREAM_READER_LE
index 7101f8033fa53c6dfcf58aa1e998838e03dc6d2e..48d57721149f379a47d9b04ec5a488eca04cd705 100644 (file)
@@ -61,6 +61,8 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
 
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
 
+    avcodec_get_frame_defaults(&s->frame);
+
     return 0;
 }
 
index c205735c90cf082bcfcdcf19d39f9d47292319d2..6ef9b0b351074aafc67ed02dd7dfd0378633815c 100644 (file)
@@ -64,6 +64,7 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
     mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
     mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel));
     avctx->pix_fmt = AV_PIX_FMT_RGB555;
+    avcodec_get_frame_defaults(&mp->frame);
     return 0;
 }
 
index 24fa523363879eb5ee54b4827e6b231a83d7de6e..fe6819cc18ebea3ef689db868f6f7b88e5d94efe 100644 (file)
@@ -66,7 +66,7 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
 
     return 0;
 }
index d0aee12d49bb124b6d51d78048fe38731eca92c5..fd968bce2cee7a1da4f247702d2c3a98d16706d4 100644 (file)
@@ -72,7 +72,7 @@ static av_cold int msvideo1_decode_init(AVCodecContext *avctx)
         avctx->pix_fmt = AV_PIX_FMT_RGB555;
     }
 
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
 
     return 0;
 }
index afcb2dfc97619c1dbe5523bd21d8b3813dd5964b..bb963ed1a3d69828846c6a59139eda08dcdd5ee8 100644 (file)
@@ -295,6 +295,8 @@ static av_cold int decode_init(AVCodecContext *avctx){
     avctx->pix_fmt= AV_PIX_FMT_PAL8;
     a->refdata = av_malloc(avctx->width * avctx->height);
 
+    avcodec_get_frame_defaults(&a->pic);
+
     return 0;
 }
 
index 7a1213f6011757d4e10cac0af30cf4ec1f5ab403..b4667f43bb06d815cae5ecb3a48845484b7c888a 100644 (file)
@@ -385,7 +385,7 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
 
     return 0;
 }
index dd2b547afc05ff38e3470a65dd856f29d2659bd6..45350a85d8e8905484c106905e1d014780886da6 100644 (file)
@@ -239,7 +239,7 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx)
     s->avctx = avctx;
     avctx->pix_fmt = AV_PIX_FMT_RGB555;
 
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
 
     return 0;
 }
index c37fb14a4d268214b15c309fad21b5bed72984fb..a27997f361ef96a7bd82ebfd553463943136173e 100644 (file)
@@ -518,7 +518,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     c->avctx = avctx;
 
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
+    avcodec_get_frame_defaults(&c->pic);
 
     /* decode huffman trees from extradata */
     if(avctx->extradata_size < 16){
index de81a43e9101a473794253e3dc27692953555a46..d16242bf506a8c22e4007468c385cbd3bce86af6 100644 (file)
@@ -417,7 +417,7 @@ static av_cold int smc_decode_init(AVCodecContext *avctx)
     s->avctx = avctx;
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
 
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
 
     return 0;
 }
index 5d5d69434bed749bfc4591c12f1c13736e000431..50f8921ddef30509591dfccda1308f055c502e5f 100644 (file)
@@ -217,7 +217,7 @@ static av_cold int seqvideo_decode_init(AVCodecContext *avctx)
     seq->avctx = avctx;
     avctx->pix_fmt = AV_PIX_FMT_PAL8;
 
-    seq->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&seq->frame);
 
     return 0;
 }
index 01d4694e14f1ab6b128a21f3cc05352316b75582..f8a8dad3e94dcac4edd6aff2d1a6705464111f2e 100644 (file)
@@ -468,7 +468,7 @@ static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
 //    else
 //        avctx->pix_fmt = AV_PIX_FMT_RGB555;
 
-    s->frame.data[0] = NULL;
+    avcodec_get_frame_defaults(&s->frame);
 
     /* there is a vertical predictor for each pixel in a line; each vertical
      * predictor is 0 to start with */
index 2ecfb93161ee8147d8461f692ba697b64c9d0541..342cb05e15b4daec1549cebd41d5d2c21ae3927f 100644 (file)
@@ -900,7 +900,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     }
 
     l->avctx       = avctx;
-    l->pic.data[0] = NULL;
+    avcodec_get_frame_defaults(&l->pic);
     avctx->pix_fmt = AV_PIX_FMT_BGR24;
 
     ff_dsputil_init(&l->dsp, avctx);
index e99c26725b601bffa943485c1092ef1671d1bccb..3825980cfbbfade16c8a9f169dcf870b1387e6cf 100644 (file)
@@ -53,6 +53,7 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx)
     avctx->pix_fmt = AV_PIX_FMT_YUV410P;
     avctx->coded_frame = &s->frame;
     s->ulti_codebook = ulti_codebook;
+    avcodec_get_frame_defaults(&s->frame);
 
     return 0;
 }
index 41e4730b4483d8d19c5920ab52d1784f56acaa9c..d060d5b81f338a74973b56f611b9f637f276c5cd 100644 (file)
@@ -488,6 +488,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
+    avcodec_get_frame_defaults(&c->pic);
+
     return 0;
 }