On Mon, 20 Oct 2014, Vittorio Giovara wrote:

CC: [email protected]
Bug-Id: CID 1197050
---
libavformat/mov.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0e29bf3..b8d9f4c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3192,10 +3192,11 @@ static int mov_read_header(AVFormatContext *s)
        MOVStreamContext *sc = st->priv_data;

        if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-            if (st->codec->width <= 0 && st->codec->width <= 0) {
+            if (st->codec->width <= 0)
                st->codec->width  = sc->width;
+            if (st->codec->height <= 0)
                st->codec->height = sc->height;
-            }
+

I'm not sure if it makes sense to set them separately; I think it would make slightly more sense to change the existing check into what probably was intended, i.e.

if (st->codec->width <= 0 || st->codec->height <= 0) {
 // Set both width and height
}

Keeping one of the values but setting the other rarely make sense.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to