]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qpeg.c
Remove a few if (p) av_free(p) forms
[ffmpeg] / libavcodec / qpeg.c
index 64ab74b2b2ce10f656214ca962fc9ba9b7134f18..e4c2291f3979b346b43a4da5f7e358cd2ddac7d0 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 /**
- * @file libavcodec/qpeg.c
+ * @file
  * QPEG codec.
  */
 
@@ -289,9 +289,12 @@ static int decode_frame(AVCodecContext *avctx,
 static av_cold int decode_init(AVCodecContext *avctx){
     QpegContext * const a = avctx->priv_data;
 
+    if (!avctx->palctrl) {
+        av_log(avctx, AV_LOG_FATAL, "Missing required palette via palctrl\n");
+        return -1;
+    }
     a->avctx = avctx;
     avctx->pix_fmt= PIX_FMT_PAL8;
-    a->pic.data[0] = NULL;
     a->refdata = av_malloc(avctx->width * avctx->height);
 
     return 0;
@@ -308,9 +311,9 @@ static av_cold int decode_end(AVCodecContext *avctx){
     return 0;
 }
 
-AVCodec qpeg_decoder = {
+AVCodec ff_qpeg_decoder = {
     "qpeg",
-    CODEC_TYPE_VIDEO,
+    AVMEDIA_TYPE_VIDEO,
     CODEC_ID_QPEG,
     sizeof(QpegContext),
     decode_init,