]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/tiffenc.c
mjpegdec: Properly fail on malloc failure
[ffmpeg] / libavcodec / tiffenc.c
index fbdb8248fac89aa19e3b2a6d2e8042dac579e4cc..7c23ee2db85693ae57766094bb9fe33879824500 100644 (file)
@@ -309,7 +309,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     strips = (s->height - 1) / s->rps + 1;
 
     packet_size = avctx->height * ((avctx->width * s->bpp + 7) >> 3) * 2 +
-                  avctx->height * 4 + FF_MIN_BUFFER_SIZE;
+                  avctx->height * 4 + AV_INPUT_BUFFER_MIN_SIZE;
 
     if (!pkt->data &&
         (ret = av_new_packet(pkt, packet_size)) < 0) {
@@ -446,7 +446,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     ADD_ENTRY(s,  TIFF_YRES,         TIFF_RATIONAL, 1,      res);
     ADD_ENTRY1(s, TIFF_RES_UNIT,     TIFF_SHORT,    2);
 
-    if (!(avctx->flags & CODEC_FLAG_BITEXACT))
+    if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT))
         ADD_ENTRY(s, TIFF_SOFTWARE_NAME, TIFF_STRING,
                   strlen(LIBAVCODEC_IDENT) + 1, LIBAVCODEC_IDENT);
 
@@ -490,8 +490,12 @@ fail:
 
 static av_cold int encode_init(AVCodecContext *avctx)
 {
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
     avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     return 0;
 }