[FFmpeg-cvslog] pgssubdec: fix API compability layer

Petri Hintukainen git at videolan.org
Mon Dec 7 14:20:36 CET 2015


ffmpeg | branch: master | Petri Hintukainen <phintuka at gmail.com> | Thu Nov 26 10:33:42 2015 +0200| [7139489c452ef8af6a745ec4e62056ee4ea4d6a8] | committer: Luca Barbato

pgssubdec: fix API compability layer

Copy pointers to AVPicture after memory has been allocated.
Fixes NULL pointers in AVPicture after a17a7661906ba295d67afd80ac0770422e1b02b3.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7139489c452ef8af6a745ec4e62056ee4ea4d6a8
---

 libavcodec/pgssubdec.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index d58b491..7bcb1ed 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -543,16 +543,6 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
 
         sub->rects[i]->linesize[0] = object->w;
 
-#if FF_API_AVPICTURE
-FF_DISABLE_DEPRECATION_WARNINGS
-        rect = sub->rects[i];
-        for (j = 0; j < 4; j++) {
-            rect->pict.data[j] = rect->data[j];
-            rect->pict.linesize[j] = rect->linesize[j];
-        }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
         if (object->rle) {
             if (object->rle_remaining_len) {
                 av_log(avctx, AV_LOG_ERROR, "RLE data length %u is %u bytes shorter than expected\n",
@@ -582,6 +572,16 @@ FF_ENABLE_DEPRECATION_WARNINGS
             return AVERROR(ENOMEM);
         }
 
+#if FF_API_AVPICTURE
+FF_DISABLE_DEPRECATION_WARNINGS
+        rect = sub->rects[i];
+        for (j = 0; j < 4; j++) {
+            rect->pict.data[j] = rect->data[j];
+            rect->pict.linesize[j] = rect->linesize[j];
+        }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
         memcpy(sub->rects[i]->data[1], palette->clut, sub->rects[i]->nb_colors * sizeof(uint32_t));
 
     }



More information about the ffmpeg-cvslog mailing list