On Wed, Jun 04, 2014 at 04:56:15PM +0530, Nidhi Makhijani wrote:
> --- a/libavformat/nutdec.c
> +++ b/libavformat/nutdec.c
> @@ -230,7 +230,8 @@ static int decode_main_header(NUTContext *nut)
>
> GET_V(nut->time_base_count, tmp > 0 && tmp < INT_MAX /
> sizeof(AVRational));
> nut->time_base = av_malloc(nut->time_base_count * sizeof(AVRational));
> -
> + if (!nut->time_base)
> + return AVERROR(ENOMEM);
> for (i = 0; i < nut->time_base_count; i++) {
Keep the empty line.
> @@ -312,8 +313,13 @@ static int decode_main_header(NUTContext *nut)
> return AVERROR_INVALIDDATA;
> }
> hdr = av_malloc(nut->header_len[i]);
> - if (!hdr)
> + if (!hdr) {
> + int j;
> + for (j=1; j < i; j++)
spaces around operators (more below)
> @@ -599,6 +614,8 @@ static int find_and_decode_index(NUTContext *nut)
> GET_V(syncpoint_count, tmp < INT_MAX / 8 && tmp > 0);
> syncpoints = av_malloc(sizeof(int64_t) * syncpoint_count);
> has_keyframe = av_malloc(sizeof(int8_t) * (syncpoint_count + 1));
> + if (!syncpoints || !has_keyframe)
> + goto fail;
> for (i = 0; i < syncpoint_count; i++) {
You missed setting an appropriate return value.
> @@ -812,7 +829,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt,
> int frame_code)
> AVFormatContext *s = nut->avf;
> AVIOContext *bc = s->pb;
> - int size, stream_id, discard;
> + int size, stream_id, discard,ret;
space after comma
Please learn to notice and match surrounding code style.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel