Fixes e.g.

ffmpeg -i fate-suite/h264/bbc2.sample.h264 -c:v rawvideo -map 0:v -frames:v 10 
-pix_fmt gray8 -f tee "first.mov|second.mov"

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>
---
 libavformat/movenc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index a4dace7c1d..5608afde42 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6513,6 +6513,9 @@ static int mov_write_packet(AVFormatContext *s, AVPacket 
*pkt)
             } else if (trk->par->codec_id == AV_CODEC_ID_RAWVIDEO &&
                        (trk->par->format == AV_PIX_FMT_GRAY8 ||
                        trk->par->format == AV_PIX_FMT_MONOBLACK)) {
+                ret = av_packet_make_writable(pkt);
+                if (ret < 0)
+                    goto fail;
                 for (i = 0; i < pkt->size; i++)
                     pkt->data[i] = ~pkt->data[i];
             }
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to