[FFmpeg-cvslog] avcodec_align_dimensions2: Ensure cinepak has large enough buffers.

Michael Niedermayer git at videolan.org
Thu Feb 21 03:54:50 CET 2013


ffmpeg | branch: release/0.7 | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 20 02:24:30 2013 +0100| [2b6f3be08250683407c7a9846d7133b116661eae] | committer: Michael Niedermayer

avcodec_align_dimensions2: Ensure cinepak has large enough buffers.

This is partly redundant with the following patches, but its safer

Found-by: u-bo1b at 0w.se
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit f5c00b347dc76285c639d9878a014c40395c5228)

Conflicts:

	libavcodec/utils.c

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/utils.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8d5208f..8a7f185 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -170,9 +170,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
     case PIX_FMT_PAL8:
     case PIX_FMT_BGR8:
     case PIX_FMT_RGB8:
-        if(s->codec_id == CODEC_ID_SMC){
-            w_align=4;
-            h_align=4;
+        if (s->codec_id == CODEC_ID_SMC ||
+            s->codec_id == CODEC_ID_CINEPAK) {
+            w_align = 4;
+            h_align = 4;
         }
         break;
     case PIX_FMT_BGR24:
@@ -181,6 +182,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
             h_align=4;
         }
         break;
+    case PIX_FMT_RGB24:
+        if (s->codec_id == CODEC_ID_CINEPAK) {
+            w_align = 4;
+            h_align = 4;
+        }
+        break;
     default:
         w_align= 1;
         h_align= 1;



More information about the ffmpeg-cvslog mailing list