[FFmpeg-cvslog] rmdec: validate block alignment

Andreas Cadhalpun git at videolan.org
Wed Nov 23 02:21:54 EET 2016


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Thu Nov 17 22:46:40 2016 +0100| [de4ded06366e5767d0af277a61d9a56b8c8f9c19] | committer: Andreas Cadhalpun

rmdec: validate block alignment

This fixes division by zero crashes.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

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

 libavformat/rmdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index d175862..4d56529 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -934,6 +934,10 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
 
              ast->sub_packet_cnt = 0;
              rm->audio_stream_num = st->index;
+            if (st->codecpar->block_align <= 0) {
+                av_log(s, AV_LOG_ERROR, "Invalid block alignment %d\n", st->codecpar->block_align);
+                return AVERROR_INVALIDDATA;
+            }
              rm->audio_pkt_cnt = h * w / st->codecpar->block_align;
         } else if ((ast->deint_id == DEINT_ID_VBRF) ||
                    (ast->deint_id == DEINT_ID_VBRS)) {



More information about the ffmpeg-cvslog mailing list