]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ljpegenc.c
h264: fix bit depth changes with frame threading
[ffmpeg] / libavcodec / ljpegenc.c
index 78ba2c962e581fe1e2970d07b57364b04859bc5d..c7291ada67b80a22eed5d3a8fc32505a7ed14e1d 100644 (file)
@@ -31,7 +31,6 @@
  */
 
 #include "avcodec.h"
-#include "dsputil.h"
 #include "internal.h"
 #include "mpegvideo.h"
 #include "mjpeg.h"
@@ -64,7 +63,10 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
 
     init_put_bits(&s->pb, pkt->data, pkt->size);
 
-    *p = *pict;
+    av_frame_unref(p);
+    ret = av_frame_ref(p, pict);
+    if (ret < 0)
+        return ret;
     p->pict_type= AV_PICTURE_TYPE_I;
     p->key_frame= 1;