[FFmpeg-devel] 0001-Avoid-segfault-in-a64_write_header-when-stream-codec.patch

Andrey Myznikov andrey.myznikov at gmail.com
Mon Aug 18 18:35:50 CEST 2014


Hello,

     Attached patch fixes segmentation fault in libavformat/a64.c 
a64_write_header() when output stream's codec is not open, so 
avctx->codec is NULL (in "stream_copy" use case for example). Correct 
access to codec id is use of "avctx->codec_id" instead of 
"avctx->codec->id".

Additionally, in 'default' section of switch() statement here, I propose 
to return AVERROR(ENOTSUP) instead of AVERROR_INVALIDDATA, because it is 
more clear to get someting like
      "avformat_write_header() fails: Operation not supported"

instread  of
      "avformat_write_header() fails: Invalid data found when processing 
input"

when we do output, but do not input.

Reards,
     Andrey Myznikov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Avoid-segfault-in-a64_write_header-when-stream-codec.patch
Type: text/x-patch
Size: 1006 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140818/d28182dd/attachment.bin>


More information about the ffmpeg-devel mailing list